package com.example.homescreen.dao;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
import android.util.Log;

public class DBProvider {
	public static final String TABLE_NAME = "tblfood";
	private DBHelper dbHelper;
	private SQLiteDatabase db;
	private Context context;
	public DBProvider(Context context) {
		dbHelper = new DBHelper(context);
	}

	public boolean onCreate() {
		dbHelper = new DBHelper(context);
		return false;
	}

	public Cursor query(Uri uri, String[] projection, String selection,
			String[] selectionArgs, String sortOrder) {
		Cursor c = null;

		try {
			dbHelper.openDatabase();
			db = dbHelper.getReadableDatabase();
			c = db.query(TABLE_NAME, projection, selection, selectionArgs,
					null, null, sortOrder);

		} catch (SQLiteException e) {
			Log.e("Database Error", e.getMessage());
		}
		dbHelper.closeDatabase();
		return c;
	}

	public String getType(Uri uri) {
		// TODO Auto-generated method stub
		return null;
	}

	public Uri insert(Uri uri, ContentValues values) {
		// TODO Auto-generated method stub
		return null;
	}

	public int delete(Uri uri, String selection, String[] selectionArgs) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int update(Uri uri, ContentValues values, String selection,
			String[] selectionArgs) {
		// TODO Auto-generated method stub
		return 0;
	}

}
